//
//  HomeAttentionHasNoneAttentionUserList.swift
//  HomeAttentionHasNoneAttentionUserList
//
//  Created by Ben on 2021/8/31.
//

import SwiftUI

struct HomeAttentionHasNoneAttentionUserList: View {
    var body: some View {
        
        // 这里是之前写的未关注任何人情况下的关注页面
        List(0..<(DEFAULT_ATTENTION_FUNUSER_MODELS.count + 1)) { index in
            
            if index == 0 {
                // 未关注的提示
                HomeAttentionHasNoneAttentionUserCell()
                // 取消cell默认分割线
                    .listRowSeparator(.hidden)
                    .listRowInsets(.zero)

            } else {
                
                ForEach(DEFAULT_ATTENTION_FUNUSER_MODELS) { model in
                    
                    // 完成推荐的有趣的人列表
                    HomeAttentionFunUserCell(funUserModel: model)
                        .listRowSeparator(.hidden)
                    // 清除cell默认的内间距
                        .listRowInsets(.zero)
                        .buttonStyle(.plain)
                }
            }
        }
        .listStyle(.plain)
    }
}

struct HomeAttentionHasNoneAttentionUserList_Previews: PreviewProvider {
    static var previews: some View {
        HomeAttentionHasNoneAttentionUserList()
    }
}
